<!DOCTYPE html>
<title>Test that the "progress" event is not fired periodically for a MediaStream.</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<video></video>
<script>
async_test(function(t) {
    var video = document.querySelector("video");
    navigator.mediaDevices.getUserMedia({ video: true }).then(function(stream) {
        video.srcObject = stream;
        video.play();
    }, t.unreached_func("getUserMedia failed"));

    var num_progress = 0;
    video.onprogress = () => { num_progress += 1; };

    // Wait 1.5 second to ensure that the "progress" event is not fired more
    // than once.
    setTimeout(t.step_func_done(() => {
      assert_equals(num_progress, 1);
    }), 1500);
});
</script>
